<template>
  <view class="user-center">
    <!-- 用户信息 -->
    <view class="header">
      <view class="avatar">
        <image class="avatar-img" src="https://placehold.co/86x86?text=L" mode="aspectFill" />
      </view>
      <view class="username">未登录</view>
      <view class="uid">UID: xxxxxxxx</view>
    </view>

    <!-- 渐变卡片 -->
    <view class="cards">
      <view class="card order" @click="applyArbitration">
        <view class="meta">
          <view class="icon">
            <image class="card-icon" src="/static/icon/gavel.png" mode="aspectFit" />
          </view>
          <view class="chev">›</view>
        </view>
        <view class="card-content">
          <view class="title">申请仲裁</view>
          <view class="muted">对订单提交仲裁申请</view>
        </view>
      </view>
    </view>

    <!-- 列表项 -->
    <view class="menu">
      <view class="item" @click="viewProfile">
        <view class="left">
          <view class="icon-sq">
            <image class="menu-icon" src="/static/icon/userinf.png" mode="aspectFit" />
          </view>
          <view class="text">
            <view class="label">个人资料</view>
            <view class="sub">查看并编辑个人信息</view>
          </view>
        </view>
        <view>›</view>
      </view>

      <view class="item" @click="openSettings">
        <view class="left">
          <view class="icon-sq">
            <image class="menu-icon" src="/static/icon/setting.png" mode="aspectFit" />
          </view>
          <view class="text">
            <view class="label">设置</view>
            <view class="sub">隐私与通知</view>
          </view>
        </view>
        <view>›</view>
      </view>

      <view class="item" @click="aboutUs">
        <view class="left">
          <view class="icon-sq">
            <image class="menu-icon" src="/static/icon/about.png" mode="aspectFit" />
          </view>
          <view class="text">
            <view class="label">关于我们</view>
            <view class="sub">功能说明与版本信息</view>
          </view>
        </view>
        <view>›</view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  methods: {
    viewProfile() {
      uni.navigateTo({
        url: '/pages/user/userinf'
      })
    },
    openSettings() {
      uni.showToast({ title: '打开设置（示例）', icon: 'none' })
    },
    aboutUs() {
      uni.showToast({ title: '关于我们（示例）', icon: 'none' })
    },
    applyArbitration() {
      uni.showToast({ title: '申请仲裁（示例）', icon: 'none' })
    },
  }
}
</script>

<style scoped>
.user-center {
  padding: 18px;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
  min-height: 100vh;
  padding-bottom: 50px; /* 为底部导航栏留出空间 */
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 16px 8px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}

.avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.12);
  cursor: pointer;
  border: 4px solid #fff;
}

.avatar-img {
  width: 86px;
  height: 86px;
  border-radius: 50%;
}

.username {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.uid {
  font-size: 12px;
  color: #6b7280;
}

.cards {
  display: flex;
  gap: 12px;
  padding: 0 6px;
  margin-bottom: 12px;
}

.card {
  flex: 1;
  border-radius: 12px;
  padding: 16px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
  cursor: pointer;
  transition: transform 0.18s ease;
  position: relative;
  overflow: hidden;
}

.card:active {
  transform: translateY(2px);
}

.card .icon {
  font-size: 38px;
  font-weight: 700;
}

.card-icon {
  width: 38px;
  height: 38px;
}

.card .title {
  font-weight: 700;
  font-size: 16px;
  color: white;
}

.card .chev {
  font-weight: 700;
  color: white;
  font-size: 20px;
}

.card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card .muted {
  font-size: 12px;
  opacity: 0.9;
  color: white;
}

.card-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* 渐变样式：申请仲裁（紫→青）*/
.card.order {
  background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
}

.card.order::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0));
  transform: rotate(20deg);
}


.menu {
  padding: 6px 6px 20px 6px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px;
  background: white;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.03);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.item:active {
  transform: translateY(2px);
}

.left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-sq {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.menu-icon {
  width: 24px;
  height: 24px;
}

.label {
  font-weight: 600;
  color: #0f172a;
}

.sub {
  font-size: 12px;
  color: #6b7280;
}
</style>